<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name),
             :html => {:id => "signUpFormID", :class=> "form-horizontal well application-form"}) do |f| %>
    <legend><%=t('form.title.sign_up') %></legend>
    <span class="help-block">
      <%=t('info.registration')%>
    </span>
    <br/>

    <!--email field-->
    <div <% if resource.errors[:email].present? %>
            class="control-group error"
         <%elsif resource.errors.any?%>
            class="control-group success"
         <%else%>
            class="control-group"
         <% end %>>
        <%= label_tag :email, t('field.user.email'), :class => "control-label" %>
        <div class="controls">
            <%= f.email_field :email, :id => :email %>
            <% if resource.errors[:email].present? %>
              <% resource.errors[:email].each do |msg|%>
                  <p class="help-block"><%= msg%></p>
              <%end%>
            <%end%>
        </div>
    </div>

    <!--password field-->
    <div <% if resource.errors[:password].present? %>
            class="control-group error"
         <%elsif resource.errors.any?%>
            class="control-group success"
         <%else%>
            class="control-group"
         <% end %>>
        <%= label_tag :password, t('field.user.password'), :class => "control-label" %>
        <div class="controls">
            <%= f.password_field :password, :id => :password, :html => {:maxlength => 128} %>
            <% if resource.errors[:password].present? %>
              <% resource.errors[:password].each do |msg|%>
                  <p class="help-block"><%= msg%></p>
              <%end%>
            <%end%>
        </div>
    </div>
    
    <!--confirm password field-->
    <div <% if resource.errors[:password_confirmation].present? %>
            class="control-group error"
         <%elsif resource.errors.any?%>
            class="control-group success"
         <%else%>
            class="control-group"
         <% end %>>
        <%= label_tag :password_confirmation, t('field.user.password_confirm'), :class => "control-label" %><br />
        <div class="controls">
            <%= f.password_field :password_confirmation, :id => :password_confirmation, :html => {:maxlength => 128} %>
            <% if resource.errors[:password_confirmation].present? %>
                <% resource.errors[:password_confirmation].each do |msg|%>
                    <p class="help-block"><%= msg%></p>
                <%end%>
            <%end%>
        </div>
    </div>

    <!--navigation links and submit form button-->
    <div class="control-group">
      <div class="controls">
        <div>
          <%= link_to t('link.to_login_page'), new_session_path(resource_name)%>
        </div>
        <div class="margintop10px">
          <%= link_to t('link.forgot_password'), new_password_path(resource_name) %>
        </div>
        <div class="margintop10px">
          <%= f.submit t('link.sign.up'), :class=>"btn btn-primary", :title=>t('link.sign.up') %>
        </div>
      </div>
    </div>
<% end %>

